import React from 'react'

import useMouse from '@/hooks/useMouse'

const Child = (props) => {
  const { x, y } = useMouse()
  console.log('child render')
  return (
    <div>
      <button onClick={() => props.inc(1)}>1</button>
      <button onClick={() => props.inc(2)}>2</button>
      <button onClick={() => props.inc(3)}>3</button>
      <p>
        x坐标： {x}, y坐标： {y},
      </p>
    </div>
  )
}

export default React.memo(Child)
